#!/bin/bash

read -p "Please Input The Vhost Name:" vhost
if [ ! -n "$vhost" ]; then
    echo "Please Input The Vhost Name"
    exit 0
else
    result=$(docker ps -a | grep "$vhost-apache-php")
    if [ ! "$result" ]; then
        echo "The Vhost Is Not Exists!"
        exit 0
    else
        docker stop $vhost-apache-php
        docker rm $vhost-apache-php
        rm -rf ./apache/$vhost-sites
        rm ./apache/logs/$vhost-access.log
        rm ./apache/logs/$vhost-error.log
        #为了安全期间,不自动删除代码,请手动删除
        #rm -rf ./apps/$vhost
    fi
fi